/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bgate.game;

import javax.microedition.lcdui.Display;
import javax.microedition.midlet.*;

/**
 * @author thinhnv
 */
public class MyMidlet extends MIDlet {

    Display display;

    public MainGame game;

    public PipoFLash pipoFLash;
    
    public UserInfoRMS userInfoRMS;

    public void startApp() {
        try {

            userInfoRMS = new UserInfoRMS("Tên Game");
            userInfoRMS.loadInfo();

            display = Display.getDisplay(this);

//            pipoFLash = new PipoFLash(this);
//
//            pipoFLash.start();
//
//            display.setCurrent(pipoFLash);
            displayMainGame();

        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    public void displayMainGame() {
        if (game == null) {
            game = new MainGame(this);
        }
        display.setCurrent(game);
        game.start();
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
        notifyDestroyed();
    }
}
